<%@ page import="java.util.Date" %><%--
  Function: 
  User: PING
  Date: 2022/9/22

--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<%
    String sId = session.getId() ;
    Date lastTime = new Date(session.getLastAccessedTime()) ;
    Cookie [] cookies = request.getCookies() ;
    if (cookies != null) {
        for (Cookie cookie : cookies) {
            out.println("Cookie name : " + cookie.getName() + ", value : " + cookie.getValue());
        }
    }
    Cookie newCookie = new Cookie("test", "helloworld") ;
    newCookie.setMaxAge(60);
    response.addCookie(newCookie) ;
    out.println("maxTIme" + session.getMaxInactiveInterval()) ;


%>
<form action="testProcess.jsp" method="POST">
    你的爱好：<input type="checkbox" name="fav" id="run" value="run"><label for="run">跑步</label><br>
    <input type="checkbox" name="fav" id="swim" value="swim"><label for="swim">游泳</label><br>
    <input type="checkbox" name="fav" id="read" value="read"><label for="read">读书</label><br>
    <input type="checkbox" name="fav" id="write" value="write"><label for="write">写字</label><br>
    <input type="submit" value="submit">
</form>

</body>
</html>
